from typing import List
from src.utils.srt_utils import get_srt_texts
from src.utils.text_utils import remove_non_chinese


class SrtSegmentInfo():
    def __init__(self,start,end,text,duration,index,ignore=False):
        self.start = start
        self.end = end
        self.text = remove_non_chinese(text)
        self.index = index
        self.duration = duration
        self.ignore = ignore


class VideoSrtInfo():
    def __init__(self,srt_file):
        self.srt_infos:List[SrtSegmentInfo] = []
        for info in get_srt_texts(srt_file):
            srtSegmentInfo = SrtSegmentInfo(**info)
            self.srt_infos.append(srtSegmentInfo)


